package cn.gzlsdl.glassesmanage.common.util;


import org.apache.commons.codec.digest.DigestUtils;
import org.apache.shiro.codec.Base64;

/**
 * Class SecurityUtil
 * Description:加密工具类 base64、MD5、sha256
 * @author luxiaobo
 * Created on 2019/5/17
 */
public class SecurityUtil {

    public static String base64Encode(String data){
        return Base64.encodeToString(data.getBytes());
    }

    public static String base64Decode(String data){
        return Base64.decodeToString(data.getBytes());
    }

    public static String md5Hex(String data){
        return DigestUtils.md5Hex(data.getBytes());
    }

    public static String sha256Hex(String data){
        return DigestUtils.sha256Hex(data.getBytes());
    }
}
